/*
方案一：Spin的tip生效需要Spin作为包裹容器时，内部有子元素时才生效，否则tip无效


// index.tsx-----------------------------------------------------------------------
import './loading.less';

import { createRoot } from 'react-dom/client';

import Loading from './Loading';


let count: number = 0; // 保证全局唯一loading
export const showLoading = () => {
    if (count === 0) {
        const dom = document.createElement('div');
        dom.setAttribute('id', 'loading');
        document.body.appendChild(dom);
        // 渲染 Loading 元素
        createRoot(dom).render(<Loading />);
    }
    // 防止 count 溢出
    if (count < Number.MAX_SAFE_INTEGER) {
        count++;
    }
};

export const hideLoading = () => {
    if (count > 0) {
        count--;
    }
    if (count <= 0) {
        count = 0;
        const dom = document.getElementById('loading') as HTMLDivElement;
        document.body.removeChild(dom);
    }
};

// loading.less-----------------------------------------------------------------------
#loading {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 20px;

    .loading-tip {
        font-size: 20px;
        color: #1677ff;
        text-shadow : 0 1px 2px #fff
    }
}



// Loading.tsx-----------------------------------------------------------------------
import { Spin } from 'antd';

const Loading = ({ tip = 'loading' }: { tip?: string }) => {
    return (
        <Spin
            className="request-loading"
            size="large"
            tip={tip}
        />
    );
};

export default Loading;

 */
